# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libglade
pkgver=2.6.4
pkgrel=15
pkgdesc="Allows you to load glade interface files in a program at runtime"
url="http://www.gnome.org"
arch="all"
license="LGPL-2.0-or-later"
subpackages="$pkgname-dev $pkgname-doc"
depends="libxml2-utils"
depends_dev="gtk+2.0-dev libxml2-dev"
makedepends="$depends_dev autoconf automake libtool"
install="$pkgname.post-install $pkgname.pre-upgrade $pkgname.post-upgrade
	$pkgname.post-deinstall"
source="https://download.gnome.org/sources/libglade/2.6/libglade-$pkgver.tar.bz2
	$pkgname-2.0.1-nowarning.patch
	libglade-gmodule.patch
	"


prepare() {
	default_prepare
	update_config_sub
	libtoolize --force && aclocal && autoheader && autoconf \
		&& automake --add-missing
}

build() {
	sed -i '/DG_DISABLE_DEPRECATED/d' glade/Makefile.in
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--sysconfdir=/etc \
		--prefix=/usr \
		--disable-static \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -m755 libglade-convert "$pkgdir"/usr/bin/
}

sha512sums="b725842febaf4c1f0d305a629ae1c61ea2de24dd6f41937e806c078fada2cea483195ef40f5238ce2045e47130c92559e984f677de667b840dd7fff0f8559735  libglade-2.6.4.tar.bz2
5ab9dfb85938fb7e9ec637a9d68f3db961f3986e1eb9eec0d684af4ce2361c83d6998283b2bd5b4e1bd7950ca456cc3ea7fae567ac52ae391f6c9d5456c6dd2e  libglade-2.0.1-nowarning.patch
8ab898ca484ebcf2fbb39a9f6e59f214f8c378f1b50c9abd1553a8dfb1e087f4bd7c90d74b5a02d2f92994707fcb3c351203669193b6511c493486e676023224  libglade-gmodule.patch"
